<?php
/* This file is part of a copyrighted work; it is distributed with NO WARRANTY.
 * See the file COPYRIGHT.html for more details.
 */

  require_once("../functions/inputFuncs.php");
  require_once('../classes/DmQuery.php');
  $dmQ = new DmQuery();
  $dmQ->connect();
  $stateDm = $dmQ->getAssoc('state_dm');
  $areaDm = $dmQ->getAssoc('area_dm');
  $cityDm = $dmQ->getAssoc('city_dm');
  $departamentDm = $dmQ->getAssoc('departament_dm');
  $dmQ->close();
  $fields = array(
    "schoolFldsState" => inputField('select', 'stateid', $school->getStateId(), NULL, $stateDm),
    "schoolFldsCue" => inputField('text', "cue", $school->getCue()),
    "schoolFldsAnexee" => inputField('text', "anexee", $school->getAnexee()),
    "schoolFldsArea" => inputField('select', 'areaid', $school->getAreaId(), NULL, $areaDm),
    "schoolFldsEst" => inputField('text', "est", $school->getEst()),
    "schoolFldsName" => inputField('text', "name", $school->getName()),
    "schoolFldsAddress" => inputField('text', "address", $school->getAddress()),
    "schoolFldsPhone" => inputField('text', "phone", $school->getPhone()),
    "schoolFldsCity" => inputField('select', 'cityid', $school->getCityId(), NULL, $cityDm),
  	"schoolFldsDepartament" => inputField('select', 'departamentid', $school->getDepartamentId(), NULL, $departamentDm),
  );
  
?>

<table class="primary">
  <tr>
    <th colspan="2" valign="top" nowrap="yes" align="left">
      <?php echo H($headerWording);?> <?php echo $loc->getText("schoolFldsHeader"); ?>
    </td>
  </tr>
<?php
  foreach ($fields as $title => $html) {
?>
  <tr>
    <td nowrap="true" class="primary" valign="top">
      <?php echo $loc->getText($title); ?>
    </td>
    <td valign="top" class="primary">
      <?php echo $html; ?>
    </td>
  </tr>
<?php
  }
?>
  <tr>
    <td align="center" colspan="2" class="primary">
      <input type="submit" value="<?php echo $loc->getText("schoolFldsSubmit"); ?>" class="button">
      <input type="button" onClick="self.location='<?php echo H(addslashes($cancelLocation));?>'" value="<?php echo $loc->getText("schoolFldsCancel"); ?>" class="button">
    </td>
  </tr>

</table>
